export default (name: string, url?: string):string => {
    const pattern = (
        new RegExp(`[?&#]+${name}=([^?&#]+)`)
    )
    const  res = pattern.exec(url);
    if (!res || !res[1]) return null;
    return res[1];
}

